package com.gimi.cloud.jimi.app.consumer.feign.hystrix;

import com.gimi.cloud.jimi.app.consumer.feign.OrderFeignService;
import com.gimi.cloud.jimi.common.enums.ResponseCodeEnum;
import com.gimi.cloud.jimi.common.utils.JsonUtil;
import com.gimi.cloud.jimi.common.utils.reqhead.Response;
import com.gimi.cloud.jimi.dto.order.ReplantDTO;
import com.gimi.cloud.jimi.dto.params.OrderParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * Created by shazhiwei on 2018/1/9.
 */
@Component
public class OrderHystrix implements OrderFeignService{
    private static Logger logger = LoggerFactory.getLogger(HomePageHystrix.class);

    @Override
    public String addOrder(OrderParams param) {
        logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
    }

    @Override
    public String getDataStatus(OrderParams param) {
        logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
    }

    @Override
    public String getOrderList(OrderParams param) {
        logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
    }

	@Override
	public String getOrderDetail(OrderParams param) {
		logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
	}

    @Override
    public String getReplantDetail(ReplantDTO replantDTO) {
        logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
    }


}
